﻿using DG.Tweening;
using Gp.Scripts.Core;
using UnityEngine;

namespace Gp.Scripts.GUI {
    public class IndicatorController : MonoBehaviour {
        private RotateIndicator _rotateIndicator;

        private Transform _container;
        private BaseIndicatorLine _curIndicator;
        private BaseUnit _curUnit;

        private void Start() {
            GameObject o = new GameObject("Container");
            o.transform.SetParent(this.transform);
            this._container = o.transform;
            LoadAsset();
        }


        // private ResLoader _resLoader;
        private GameObject _currentUnitMarker;


        private void LoadAsset() {
            // this.RegisterEvent<UnitSelectEvent>(UnitSelect)
            //     .UnRegisterWhenGameObjectDestroyed(gameObject);
            // _resLoader = ResLoader.Allocate();

            // _currentUnitMarker = new GameObject("Current Unit Marker");
            // _resLoader
            // .LoadSync<GameObject>(
            //     QAssetBundle.Ui_indicator.BundleName,
            //     QAssetBundle.Ui_indicator.CURRENT_UNIT_INDICATOR)
            // .InstantiateWithParent(_container, false);
        }

        // private void UnitSelect(UnitSelectEvent obj) {
        //     _currentUnitMarker.transform.RotationIdentity();
        //     _currentUnitMarker.transform.DOLocalMoveY(0.7f, 0);
        //     _currentUnitMarker.transform.DOLocalMoveZ(0, 0);
        //     _currentUnitMarker.transform.SetParent(obj.Unit.Wrapper.transform);
        //     _currentUnitMarker.transform.DOLocalMoveX(0f, 0.3f);
        // }

        // public IArchitecture GetArchitecture() {
        //     return MainArchitecture.Interface;
        // }
    }
}